package com.crm.common.crm.constant;

public enum CrmRepaidStatusEnum {
    /**
     *   `还款状态：1还款中,2已还清,3已逾期,4已代偿,5已退学,6退学中"
     */
    还款中(1, "还款中"),
    已还清(2, "已还清"),
    已逾期(3, "已逾期"),
    已代偿(4, "已代偿"),
    已退学(5, "已退学"),
    退学中(6, "退学中"),
    已作废(7, "已作废"),
    已冻结(8, "已冻结"),
    ;


    CrmRepaidStatusEnum(Integer type, String remarks) {
        this.type = type;
        this.remarks = remarks;
    }

    private Integer type;
    private String remarks;

    public String getRemarks() {
        return remarks;
    }

    public static CrmRepaidStatusEnum parse(Integer type) {
        for (CrmRepaidStatusEnum statusEnum : CrmRepaidStatusEnum.values()) {
            if (statusEnum.getType().equals(type)) {
                return statusEnum;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public static CrmRepaidStatusEnum parse(String name) {
        for (CrmRepaidStatusEnum statusEnum : CrmRepaidStatusEnum.values()) {
            if (statusEnum.name().equals(name)) {
                return statusEnum;
            }
        }
        return null;
    }
}
